﻿#region 命名空间



#endregion

using System;

namespace Sharp.DataTransferObject.CMS
{
    /// <summary>
    /// 内容页采集结果
    /// </summary>
    public class ContentPageGatherResultDTO
    {
        /// <summary>
        /// 被采集的地址
        /// </summary>
        public string URL { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string Messages { get; set; }

        /// <summary>
        /// 日志类型
        /// </summary>
        /// <remarks>0错误，1正常，2警告</remarks>
        public byte Type { get; set; }

        /// <summary>
        /// 是否已经采集
        /// </summary>
        public bool Gathered { get; set; }

        public Guid? GatherId { get; set; }

        private string _charset = string.Empty;

        public ContentPageGatherResultDTO()
        {
            Type = 1;
        }

        /// <summary>
        /// 网页编码
        /// </summary>
        public string Charset
        {
            get
            {
                if (this._charset == null)
                {
                    return string.Empty;
                }
                return this._charset;
            }
            set { this._charset = value; }
        }
    }

    /// <summary>
    /// 结果类型
    /// </summary>
    public struct ContentPageGatherResultType
    {
        /// <summary>
        /// 错误
        /// </summary>
        public const byte Err = 0;

        /// <summary>
        /// 正常
        /// </summary>
        public const byte Right = 1;

        /// <summary>
        /// 警告
        /// </summary>
        public const byte Alert = 2;

        /// <summary>
        /// 消息
        /// </summary>
        public const byte Messages = 10;
    }
}